package com.buka.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.buka.entity.Coupon;
import com.buka.request.NewUserCouponRequest;
import com.buka.service.CouponService;
import com.buka.util.JsonData;
import com.buka.vo.CouponVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * (Coupon)表控制层
 *
 * @author makejava
 * @since 2025-08-06 14:58:24
 */
@RestController
@RequestMapping("api/coupon/v1")
public class CouponController extends ApiController {

    @Resource
    CouponService couponService;

    /**
     * 分页
     * @return
     */
    @GetMapping("page")
    public JsonData page(Page page,CouponVo couponVo){
        return couponService.pageCoupon(page,couponVo);
    }

    @PostMapping("new_user_coupon")
    public JsonData newUserCoupon(@RequestBody NewUserCouponRequest user){
        return couponService.getNewUserCoupon(user);
    }


}

